package com.police.controller;

import com.loopj.android.http.RequestParams;
import com.police.router.IRouter;

import java.util.Map;

/**
 * Created by Leo on 13-5-26.
 */
public class DefaultRequest extends RequestParams implements IRequest {
    private static IRouter DefaultRouter = new com.police.router.DefaultRouter();
    private String url = "";

    public DefaultRequest(String method){
        this.url = DefaultRouter.getMethodPath(method);
    }
    public DefaultRequest(String method, Map<String, String> map) {
        super(map);
        this.url = DefaultRouter.getMethodPath(method);
    }

    @Override
    public String url() {
        return "http://" + url;
    }

    @Override
    public void putParam(String key, Object value) {
        this.put(key,value.toString());
    }

    @Override
    public String toParams() {
        return this.toString();
    }
}
